package cn.haoma.base.utils;

import java.util.Collection;
import java.util.Map;

public class NullUtil {
    /**
     * @return isEmpty or isNull
     */
    public static boolean em(String str) {
        return null == str || str.length() == 0;
    }

    /**
     * @return isEmpty or isNull
     */
    public static boolean em(Collection c) {
        return null == c || c.isEmpty();
    }

    /**
     * @return isEmpty or isNull
     */
    public static final boolean em(Map m) {
        return null == m || m.isEmpty();
    }

    /**
     * @return equals
     */
    public static final boolean eq(Object obj1, Object obj2) {
        return (obj1 == null && obj2 == null) || obj1.equals(obj2);
    }

}
